package com.anorak.betsy.retro;


import java.lang.reflect.Field;

public class XXXDecoder {

    public static final XXXDecoder xxxDecoder = new XXXDecoder();

    public final native String getSignByKey(String var1);

    static {
        try {
            initLibPath();
            System.setProperty("java.library.path", "/Users/anorak/Documents/JavaProject/standalone/Akby/musicflit/src/main/java/com/anorak/betsy/retro");
            System.loadLibrary("music_moment");
//            System.load("/Users/anorak/Documents/JavaProject/standalone/Akby/musicflit/src/main/java/com/anorak/betsy/retro/libmusic_moment.so");
        } catch (Exception e) {
            System.out.println("loadLibraryException");
        }
    }

    private static void initLibPath() throws Exception {
        String path = XXXDecoder.class.getResource("/").getPath() + "lib";
        System.setProperty("java.library.path", path);
        final Field sysPathsField = ClassLoader.class.getDeclaredField("sys_paths");
        sysPathsField.setAccessible(true);
        sysPathsField.set(null, null);
    }

    public static void main(String[] args) {
        System.out.println(System.getProperty("java.library.path"));
        String a = XXXDecoder.xxxDecoder.getSignByKey("qq_4000_0009iijj2yhfmx|0.flac");
        System.out.println(a);
    }

}